<template>
	<view class="qrcode" :style="{ backgroundImage: 'url('+backgroundImage+')' }">
		<view class="qrcode-wrapper" v-if="currentTab == 0">
			<view class="choose flex-between" >
				<view>{{ venue_name }}</view>
				<view class="d-flex align-center" @click="backToList">
					<view style="color: #8a8a8a; margin-right: 20rpx;">
						<view>{{ ticket_name }}</view>
					</view>
					<u-icon name="arrow-right" color="#e1e1e1" size="24rpx"></u-icon>
				</view>
			</view>
		
			<view class="d-flex align-center flex-column" :hidden="!vueShowModel">
				<view class="destroy-code">核销码：{{ qr_code }}</view>
				<!-- <view class="tip">请在核验时出示，注意保管勿泄露</view> -->
				<!-- <u-image width="370rpx" height="370rpx"></u-image> -->
				<uQRCode ref="qrcode" canvas-id="qrcode" :value="qr_code" size="185"></uQRCode>
				<view class="tip">请在核验时出示，注意保管勿泄露</view>
				<view class="tips">
					<view class="">
						开场前<text style="color: #ffaa00;">10</text> 分钟允许进场；结束后<text
							style="color: #ffaa00;">10</text> 分钟离场，请勿超时！</view>
				</view>
			</view>
		</view>
		<view class="qrcode-wrapper" v-if="currentTab == 1">
			<view class="choose flex-between" >
				<view>{{ venue_name }}</view>
				<view class="d-flex align-center" @click="backToList">
					<view style="color: #8a8a8a; margin-right: 20rpx;">
						<view>{{ card_name }}</view>
					</view>
					<u-icon name="arrow-right" color="#e1e1e1" size="24rpx"></u-icon>
				</view>
			</view>
		
			<view class="d-flex align-center flex-column" :hidden="!vueShowModel">
				<view class="destroy-code">核销码：{{ qr_code }}</view>
				<!-- <view class="tip">请在核验时出示，注意保管勿泄露</view> -->
				<!-- <u-image width="370rpx" height="370rpx"></u-image> -->
				<uQRCode ref="qrcode" canvas-id="qrcode" :value="qr_code" size="185"></uQRCode>
				<view class="tip">请在核验时出示，注意保管勿泄露</view>
				<view class="tips">
					<view class="">
						开场前<text style="color: #ffaa00;">10</text> 分钟允许进场；结束后<text
							style="color: #ffaa00;">10</text> 分钟离场，请勿超时！</view>
				</view>
			</view>
		</view>
		<view class="qrcode-wrapper" v-if="currentTab == 2">
			<view class="choose flex-between" >
				<view>{{ venue_name }}</view>
				<view class="d-flex align-center" @click="backToList">
					<view style="color: #8a8a8a; margin-right: 20rpx;">
						<view>{{ place_name }}</view>
					</view>
					<u-icon name="arrow-right" color="#e1e1e1" size="24rpx"></u-icon>
				</view>
			</view>
		
			<view class="d-flex align-center flex-column" :hidden="!vueShowModel">
				<view class="destroy-code">核销码：{{ qr_code }}</view>
				<!-- <view class="tip">请在核验时出示，注意保管勿泄露</view> -->
				<!-- <u-image width="370rpx" height="370rpx"></u-image> -->
				<uQRCode ref="qrcode" canvas-id="qrcode" :value="qr_code" size="185"></uQRCode>
				<view class="tip">请在核验时出示，注意保管勿泄露</view>
				<!-- <view class="tips">
					<view class="">
						开场前<text style="color: #ffaa00;">10</text> 分钟允许进场；结束后<text
							style="color: #ffaa00;">10</text> 分钟离场，请勿超时！</view>
				</view> -->
			</view>
		</view>
	</view>
</template>

<script>
	import uQRCode from '@/uni_modules/Sansnn-uQRCode/components/u-qrcode/u-qrcode.vue';
	const index = require("@/api/index/index.js");
	export default {
		components: {
			uQRCode
		},
		data() {
			return {
				backgroundImage: this.$https.assetsPath + "beij.png",
				data: {
					choose:'太行羿文体',
					goods_name:'100元充值卡'
				},
				code: '111111111',
				timer: null,
				vueShowModel: true, //默认不显示
				listQuery: { //分页
					limit: 5,
					page: 1,
				},
				totalPage: "",
				savlist:{},
				currentTab:0,
				ticket_name:'',
				card_name:'',
				place_name:'',
				venue_name:'',
				qr_code:'',
				fing:0
			}
		},
		onLoad(options) {
			console.log(options,';;;')
			if (options.currentTab == 0) {
				this.ticket_name = options.ticket_name
				this.fing = options.fing
			} else if(options.currentTab == 1){
				this.card_name = options.card_name
				this.fing = options.fing
			} else if(options.currentTab == 2){
				this.place_name = options.place_name
				this.fing = options.fing
			}
			this.venue_name = options.venue_name
			this.qr_code = options.qr_code
			this.currentTab = options.currentTab
			this.timer = null;
			console.log(this.fing,'0000')
		},
		onShow() {
			let that = this;
			that.timer = null;
			clearInterval(that.timer);
			that.timer = setInterval(() => {
				if (that.options.type == 'ticket') {
					that.choose = '选择票'
				}
			}, 30000);
		},
		onUnload() {
			let that = this;
			clearInterval(that.timer);
			that.timer = null;
		},
		onHide() {
			let that = this;
			clearInterval(that.timer);
			that.timer = null;
		},
		methods: {
			backToList(){
				uni.navigateBack();
			},
		}
	}
</script>

<style lang="scss" scoped>
	.qrcode {
		min-height: 100vh;
		padding: 20rpx;
		padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
		background-size: 100% 100vh;
		background-position: 0% 0%;

		.top {
			border-radius: 20rpx;
			padding: 30rpx 24rpx;
			background-color: #fff;
			margin-bottom: 30rpx;

			.share_a {
				width: 140rpx;
				height: 60rpx;
				border-radius: 50%;
				position: absolute;
				top: 3.3%;
				right: 3rpx;
				font-size: 28rpx;
				color: #999999;
			}

			.name {
				font-weight: bold;
				color: #333;
				margin-bottom: 20rpx;
			}

			.date {
				background-color: rgb(240, 138, 34);
				color: rgb(255, 255, 255);
				font-size: 24rpx;
				border-radius: 100px;
				padding: 4rpx 20rpx;
				margin-right: 10rpx;
				font-weight: 550;
			}

			.venue_name {
				font-size: 30rpx;
				color: #000;
				margin-top: 20rpx;
			}
		}

		.qrcode-wrapper {
			border-radius: 10rpx;
			background-color: #fff;
			overflow: hidden;
			padding-bottom: 60rpx;
			box-shadow: 0rpx 0rpx 53rpx 4rpx rgba(215,236,251,0.68);

			.choose {
				background-color: #f7f7f7;
				padding: 49rpx 30rpx 51rpx 31rpx;
			}

			.chooses {
				background-color: #f7f7f7;
				padding: 75rpx 30rpx 80rpx 31rpx;

				.my-menu {
					position: absolute;
					// top: 240rpx;
					// left: 5%;
					transform: translate(-50%);
				}

				.cates {
					display: flex;
					justify-content: center;
					position: absolute;
					top: 50%;
					left: 22rpx;
					transform: translateY(-50%);
				}

				.catess {
					display: flex;
					justify-content: center;
					position: absolute;
					top: 50%;
					left: 210rpx;
					transform: translateY(-50%);
				}

				.catesss {
					display: flex;
					justify-content: center;
					position: absolute;
					top: 50%;
					left: 390rpx;
					transform: translateY(-50%);
				}

				.cate-item {
					width: 200rpx;
					font-size: 24rpx;
					display: flex;
					flex-direction: column;
					align-items: center;
				}

				.cate-item text {
					margin-top: 10rpx;
				}

			}

			.destroy-code {
				color: #0E9698 ;
				// margin: 40rpx 0;
				margin: 40rpx 0 20rpx 0;
			}

			.tip {
				margin: 10rpx 0 30rpx 0;
				color: #999;
				font-size: 28rpx;
			}

			.tips {
				margin-top: 20rpx;
				color: #999;
				font-size: 28rpx;
			}
		}

		.fenxiang {
			color: #fff;
			margin-top: 29rpx;
		}

		.vueBgdCol {
			position: fixed;
			top: 0%;
			left: 0%;
			width: 100%;
			height: 100%;
			background-color: black;
			z-index: 1001;
			-moz-opacity: 0.8;
			opacity: 0.8;
			filter: alpha(opacity=88);
		}

		.vueContant {
			position: fixed;
			top: 40%;
			left: 50%;
			width: 600rpx;
			height: 300rpx;
			margin-left: -305rpx;
			margin-top: -76px;
			background-color: white;
			z-index: 1002;
			overflow: auto;
			border-radius: 20rpx;
		}

		.vueTitle {
			display: flex;
			justify-content: center;
			font-size: 28rpx;
			padding-top: 55rpx;
			font-weight: 600;
		}

		.vueContants {
			position: fixed;
			top: 40%;
			left: 50%;
			width: 600rpx;
			height: 330rpx;
			margin-left: -320rpx;
			margin-top: -76px;
			background-color: white;
			z-index: 1002;
			overflow: auto;
			border-radius: 20rpx;
		}

		.vueTits {
			display: flex;
			justify-content: center;
			font-size: 28rpx;
			padding-top: 75rpx;
			font-weight: 600;
		}

		.vueDetail {
			font-size: 28rpx;
			color: #646566;
			display: flex;
			// justify-content: center;
			padding: 32rpx;
			height: 48rpx;
			margin-right: 20rpx;
		}

		/deep/.u-tag {
			margin-left: 20rpx;

		}

		/deep/.u-textarea {
			background-color: #f3f3f3;
			margin-top: 80rpx;
		}

		/deep/.u-button {
			width: 30%;
			height: 60rpx;
		}

		.vueBtn {
			display: flex;
			margin-top: 80rpx;
		}

		.vueBtns {
			display: flex;
			margin-top: 100rpx;
		}

		.vueBtn span {
			width: 320rpx;
			height: 96rpx;
			font-size: 24rpx;
			font-weight: 600;
			display: flex;
			justify-content: center;
			align-items: center;
		}

		.vueBtn span:first-child {
			border-top: 1px solid #ebedf0;
		}

		.vueBtn span:last-child {
			color: #ee0a24;
			border-top: 1px solid #ebedf0;
			border-left: 1px solid #ebedf0;
		}
	}
</style>
